package com.learn.decorator;

/**
 * <p>项目名称: design-pattern </p>
 *
 * <p>文件名称: Source </p>
 *
 * Decorator that adds a club for the {@link Food}
 */
public class Source extends Food {

    private Food food;

    public Source(Food food, String desc, Integer price) {
        super.desc = desc;
        super.price = price;
        this.food = food;
    }

    @Override
    public String getDesc() {
        return food.getDesc() + "+" + desc;
    }

    @Override
    public Integer getPrice() {
        return food.getPrice() + price;
    }

}
